package com.beyondbit.hr.api.dto;

import com.fasterxml.jackson.annotation.JsonIgnore;

public class BaseRequest implements Pageable {
    Integer page;
    Integer pageSize;

    @JsonIgnore
    public Integer getLimit() {
        return pageSize;
    }

    @JsonIgnore
    public Integer getOffset() {
        if (pageSize == null || page == null)
            return null;
        return pageSize*page;
    }

    @Override
    public Integer getPage() {
        return page;
    }

    @Override
    public void setPage(Integer page) {
        this.page = page;
    }

    @Override
    public Integer getPageSize() {
        return pageSize;
    }

    @Override
    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }
}
